package com.zh.juc.callback;

/**
 * @Author: zhanghuan
 * @date: 2022/10/9 19:04
 * @description: create it
 */
public class Mother2 {

    private Son2 son;

    public Mother2(Son2 son) {
        this.son = son;
    }

    public void sayBye() {
        //1
        son.registerListener(new CallListener() {
            @Override
            public void call() {
                //5.
                System.out.println("我到学校了");
            }
        });
        //2.
        son.ride();
    }
}
